<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			function addtable() {
				var table1 = document.getElementById("table1");
				addRow(table1, 0, ["name", "age", "money"]);
				addRow(table1, 1, ["xh", 18, 5000.00]);
				addRow(table1, 1, ["xm", 19, 6000.00]);
			}

			function addcell(row, i, str) {
				var cell = row.insertCell(i);
				cell.innerHTML = str;
			}

			function addRow(obj, y, strs) {
				try {
					var row = obj.insertRow(y);
					for(var i = 0; i < strs.length; i++)
						addcell(row, i, strs[i]);
				} catch(err) {}
			}

			function fun1() {

				var odiv = document.createElement("DIV");
				document.body.appendChild(odiv);
				odiv.innerHTML = "<table id=\"table1\" style=\"display:none\" border=\"1\" width=\"500\"> </table>";
				var odiv1 = document.createElement("DIV");
				document.body.appendChild(odiv1);
				odiv1.innerHTML = " <input type=\"button\" id=\"bt1\" value=\"ok\" onclick=\"addtable()\" >"
				odiv1.innerHTML += " <input type=\"button\" id=\"bt2\" value=\"ok\" onclick=\"xianshi()\" >"
			}

			function xianshi() {

				var table1 = document.getElementById("table1");
				if(table1.style.display == "block") {
					table1.style.display = "none";
				} else {
					table1.style.display = "block";
				}

			}
			
						//			function blur1(obj, i, a) {
			//				document.getElementById("table").rows[i].cells[a].innerText = obj.value;
			//			}
			//
		

		</script>
	</head>

	<body onload="fun1()">

	</body>

</html>